
#include "Tile.h"
#include "../Sprite Management/Sprite.h"
#include "..\\Game Objects\\Camera.h"
#include "../../TinyXML/tinyxml.h"
#include "../../SGD Wrappers/SGD_GraphicsManager.h"
#include "..\Game Objects\Entity.h"

Tile::Tile()
{
	iX = -1;
	iY = -1;
}


Tile::~Tile()
{

}

int Tile::GetX()
{
	return iX;
}

int Tile::GetY()
{
	return iY;
}

void Tile::SetX(int x)
{
	iX = x;
}

void Tile::SetY(int y)
{
	iY = y;
}

//void Tile::Render(SGD::Point tilesetSize, SGD::Point tileSize, int locX, int locY)
//{
//	/*SGD::GraphicsManager::GetInstance()->DrawTextureSection(pSprite->GetImage(),
//		SGD::Point{ (float)iTileX, (float)iTileY }, SGD::Rectangle{});
//		*/
//	// Set up Rectangle to draw from tile set
//	float nLeft = (float)iTileX * tileWidth;
//	float nTop = (float)iTileY * tileHeight;
//	float nRight = nLeft + tileWidth;
//	float nBottom = nTop + tileHeight;
//
//	SGD::Rectangle srcRect;
//	srcRect.left = (GetIndex() % tilesetWidth) *;
//	srcRect.top = GetIndex() / tilesetWidth
//	SGD::Rectangle pWhich = SGD::Rectangle{ nLeft, nTop, nRight, nBottom };
//	SGD::Point offset = Camera::GetInstance()->GetPosition();
//	SGD::GraphicsManager::GetInstance()->DrawTextureSection(pSprite->GetImage(), SGD::Point{ (float)locX * tileWidth - offset.x, (float)locY * tileHeight - offset.y }, pWhich);
//}

//void Tile::CheckCollision(int locX, int locY, int tileWidth, int tileHeight, GameObject* collision)
//{
//	((Entity*)collision)->HeightmapCollision(*this, locX, locY, tileWidth, tileHeight);
//}